package com.qiang.util;

import com.qiang.service.impl.OperationAdd;
import com.qiang.service.impl.OperationMultiply;
import com.qiang.service.impl.OperationSubtract;

/**
 * @package: com.qiang.util
 * @title: StrategyPatternDemo 策略模式
 * @projectName: burning
 * @description: //TODO
 * @author zhuhongqiang3
 * @date:  2020-04-29 18:33
 * @version: V1.0
 * @retrun com.qiang.util.burning
 */
public class StrategyPatternDemo {
    public static void main(String[] args) {
        Context context = new Context(new OperationAdd());
        System.out.println("10 + 5 = " + context.executeStrategy(10, 5));

        context = new Context(new OperationSubtract());
        System.out.println("10 - 5 = " + context.executeStrategy(10, 5));

        context = new Context(new OperationMultiply());
        System.out.println("3700 * 8 = " + context.executeStrategy(3700, 8));


        System.out.println(26000 * 0.24 * 12);
    }

}
